<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="../public/tinyMCE/jquery.tinymce.js"></script>
<script type="text/javascript" src="js/initedit.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
			$('.manageedit').css({height:h-40});
		}
	}
	var forummain_js_title_empty  = "[%$ST.forummain_js_title_empty%]";
	var forummain_js_content_empty  = "[%$ST.forummain_js_content_empty%]";
	var forummain_js_edit_ok = "[%$ST.forummain_js_edit_ok%]";
	var forummain_js_edit_no = "[%$ST.forummain_js_edit_no%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: true
		}
		$('#forumedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		for (var i=0; i< formData.length; i++){
			if (formData[i].name == "content"){
				formData[i].value=tinyMCE.get('content').getContent()
			}
		}
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['title']==""){
			document.forumedit.title.focus();
			alert(forummain_js_title_empty);
			return false;
		}
		if(get['content']==''){
			alert(forummain_js_content_empty);
			return false;
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('articleselectform','articleselectall','articlecheck_all');
			alert(forummain_js_edit_ok);
		}else{
			alert(forummain_js_edit_no);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="forumedit" id="forumedit" method="post" action="index.php?archive=forummain&action=save">
	<input type="hidden" name="inputclass" value="edit">
	<input type="hidden" name="bid" value="[%$read.bid%]">
	<input type="hidden" name="lng" value="[%$read.lng%]">
	<input type="hidden" name="btid" value="[%$read.btid%]">
	<input type="hidden" name="linkebid" value="[%$read.linkebid%]">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<!--查看已选择的类型-->
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.forummain_edit_mess%] <u>[%$read.title%]</u></span></span>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.forummain_add_mess%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.forummain_add_formgroupname%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="title" size="70" value="[%$read.title%]" maxlength="100" class="infoInput"/> <span class="cautiontitle">[%$ST.forummain_add_formgroupname_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.forummain_add_purview%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="purview" id="purview">
								<option value="0">[%$ST.forummain_add_purview_option%]</option>
								[%forlist from=$memberpuvlist key=list%]
								<option  [%$memberpuvlist[list].selected%] value="[%$memberpuvlist[list].mcid%]">[%$memberpuvlist[list].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.forummain_add_keyword%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="keyword" size="50" value="[%$read.keyword%]" maxlength="80" class="infoInput"/> <span class="cautiontitle">[%$ST.forummain_add_keyword_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.forummain_add_ip%]</td>
						<td width="85%" class="trtitle02">[%$read.ip|ip(0)%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.forummain_add_addtime%]</td>
						<td width="85%" class="trtitle02">[%$read.addtime|timeformat(3)%]</td>
					</tr>
				</table>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.forummain_add_content%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr><td><textarea name="content" id="content" class="smallInput">[%$read.content%]</textarea></td></tr>
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" id="submitbotton" name="Submit" value="[%$ST.botton_edit%]" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_edit_reset%]" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>